package org.sean.framework.kafka;

import org.sean.framework.util.ThreadUtil;

import java.util.function.Supplier;

public class Asserts {

    public static <T> void asserts(int millis, Supplier<T> supplier, T returnValue) {
        int time = 0;
        while (time < millis) {
            if (returnValue.equals(supplier.get()))
                return;
            time += 500;
            ThreadUtil.sleep(500);
        }
        assert false;
    }
}
